package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementBusiMplsQoslspMapper;
import com.ruoyi.net.domain.ElementBusiMplsQoslsp;
import com.ruoyi.net.service.IElementBusiMplsQoslspService;

/**
 * 网元-业务-mpls-qoslspService业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementBusiMplsQoslspServiceImpl implements IElementBusiMplsQoslspService 
{
    @Autowired
    private ElementBusiMplsQoslspMapper elementBusiMplsQoslspMapper;

    /**
     * 查询网元-业务-mpls-qoslsp
     * 
     * @param id 网元-业务-mpls-qoslsp主键
     * @return 网元-业务-mpls-qoslsp
     */
    @Override
    public ElementBusiMplsQoslsp selectElementBusiMplsQoslspById(String id)
    {
        return elementBusiMplsQoslspMapper.selectElementBusiMplsQoslspById(id);
    }

    /**
     * 查询网元-业务-mpls-qoslsp列表
     * 
     * @param elementBusiMplsQoslsp 网元-业务-mpls-qoslsp
     * @return 网元-业务-mpls-qoslsp
     */
    @Override
    public List<ElementBusiMplsQoslsp> selectElementBusiMplsQoslspList(ElementBusiMplsQoslsp elementBusiMplsQoslsp)
    {
        return elementBusiMplsQoslspMapper.selectElementBusiMplsQoslspList(elementBusiMplsQoslsp);
    }

    /**
     * 新增网元-业务-mpls-qoslsp
     * 
     * @param elementBusiMplsQoslsp 网元-业务-mpls-qoslsp
     * @return 结果
     */
    @Override
    public int insertElementBusiMplsQoslsp(ElementBusiMplsQoslsp elementBusiMplsQoslsp)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementBusiMplsQoslsp.getId())) {
            elementBusiMplsQoslsp.setId(uuid);
        }
        elementBusiMplsQoslsp.setCreateBy(SecurityUtils.getUsername());
        elementBusiMplsQoslsp.setCreateTime(DateUtils.getNowDate());
        elementBusiMplsQoslsp.setUpdateBy(SecurityUtils.getUsername());
        elementBusiMplsQoslsp.setUpdateTime(DateUtils.getNowDate());
        return elementBusiMplsQoslspMapper.insertElementBusiMplsQoslsp(elementBusiMplsQoslsp);
    }

    /**
     * 修改网元-业务-mpls-qoslsp
     * 
     * @param elementBusiMplsQoslsp 网元-业务-mpls-qoslsp
     * @return 结果
     */
    @Override
    public int updateElementBusiMplsQoslsp(ElementBusiMplsQoslsp elementBusiMplsQoslsp)
    {
        elementBusiMplsQoslsp.setUpdateBy(SecurityUtils.getUsername());
        elementBusiMplsQoslsp.setUpdateTime(DateUtils.getNowDate());
        return elementBusiMplsQoslspMapper.updateElementBusiMplsQoslsp(elementBusiMplsQoslsp);
    }

    /**
     * 批量删除网元-业务-mpls-qoslsp
     * 
     * @param ids 需要删除的网元-业务-mpls-qoslsp主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiMplsQoslspByIds(String[] ids)
    {
        return elementBusiMplsQoslspMapper.deleteElementBusiMplsQoslspByIds(ids);
    }

    /**
     * 删除网元-业务-mpls-qoslsp信息
     * 
     * @param id 网元-业务-mpls-qoslsp主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiMplsQoslspById(String id)
    {
        return elementBusiMplsQoslspMapper.deleteElementBusiMplsQoslspById(id);
    }
}
